body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #e0f2f7; /* Light blue background */
    margin: 0;
    padding: 20px;
    color: #333;
}

h1 {
    color: #00796b; /* Teal */
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

canvas {
    border: 3px solid #00796b; /* Teal border */
    background-color: #f8fcfc; /* Very light background for canvas */
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    /* Added for responsiveness */
    width: 100%; /* Make canvas fill available width */
    max-width: 800px; /* Cap its maximum width to maintain desktop size */
    height: auto; /* Let height adjust automatically */
    aspect-ratio: 4 / 3; /* Maintain the original 800x600 aspect ratio (800/600 = 4/3) */
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

button {
    padding: 12px 25px;
    font-size: 1.1em;
    cursor: pointer;
    background-color: #00bcd4; /* Cyan */
    color: white;
    border: none;
    border-radius: 30px; /* Pill shape */
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    font-weight: bold;
}

button:hover {
    background-color: #00acc1; /* Darker cyan */
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#startStopBtn {
    background-color: #4CAF50; /* Green */
}

#startStopBtn:hover {
    background-color: #45a049;
}

#resetBtn {
    background-color: #f44336; /* Red */
}

#resetBtn:hover {
    background-color: #d32f2f;
}

.stats {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    line-height: 1.8;
    /* Removed fixed min-width for better responsiveness */
    text-align: left;
    font-size: 1.1em;
    color: #555;
    border: 1px solid #e0e0e0;
    max-width: 100%; /* Ensure it doesn't overflow on small screens */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.stats span {
    font-weight: bold;
    color: #00796b; /* Teal */
}